void bubble_sort(int array[], int length)
{
    int inner = 0, outer = 0;
    int median = 0;
    int flag = 1;

    if(NULL == array || 0 == length)
        return;
    for(outer = length - 1; outer >= 1; outer --){
        flag = 0;
        for(inner == 0; inner < outer; inner++){
            if(array[inner] > array[inner+1]){
                median = array[inner];
                array[inner] = array[inner + 1];
                array[inner+1] = median;
                if(flag == 0)
                    flag = 1;
            }
        }
    }
}